<template>
  <el-dialog
    title="表单字段配置选择"
    :visible.sync="visible"
    width="960px">
    <div class="auth-header">
      <span class="auth-th t1">数据库表单目录</span>
      <span class="auth-th t2">字段配置</span>
    </div>
    <el-tree :data="treeData" node-key="id" default-expand-all :expand-on-click-node="false">
      <span class="custom-tree-node" slot-scope="{ node, data }">
        <span>{{ node.label }}</span>
        <span>
            <el-checkbox-group v-model="data.r1" style="display:inline-block;">
            <el-checkbox class="auth-th t2" label="1">{{''}}</el-checkbox>
            </el-checkbox-group>
        </span>
      </span>
    </el-tree>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取 消</el-button>
      <el-button type="primary" @click="visible = false">确 定</el-button>
    </span>
  </el-dialog>
</template>

<script>
export default {
  data(){
    return {
      visible:false,
      treeData:[{
        id: 1,
        label: '一级 1',
        r1:['1'],
        children:[{
            id: 2,
            label: '一级 1-1',
            r1:['1'],
          }]
      }]
    }
  },
  methods:{
    show(){
      this.visible = true
    }
  }
}
</script>

<style lang="scss" scoped>
.auth-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 8px;
  background:  #F5F6FA;
  border-left:1px solid #E6E6E6;
  margin-bottom:16px;
  .auth-th{
    border:1px solid #E6E6E6;
    border-left:none;
    line-height:50px;
    color:#1E1E1E;
    font-size:16px;
    padding-left:10px;
  }
}
  .t1{
    flex:1;
  }
  .t2{
    width:200px;
  }
.custom-tree-node {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  padding-right: 8px;
  font-size: 16px;
  font-weight: 400;
  color: #1E1E1E;
}
</style>